// CSE 142, Winter 2008 // Marty Stepp, January 10 // // This program prints some really nifty egg figures. // I used static methods because the eggs and stop signs // have structure and also have redundancy with each other. // // This text is a comment (a note to the programmer), // so Java will ignore it. // public class Figures { public static void main(String[] args) { drawEgg(); System.out.println(); drawTeaCup(); System.out.println(); drawStopSign(); System.out.println(); drawHat(); } public static void drawEgg() { drawEggTop(); drawEggBottom(); } public static void drawTeaCup() { drawEggBottom(); drawLine(); } public static void drawStopSign() { drawEggTop(); System.out.println("| STOP |"); drawEggBottom(); } public static void drawHat() { drawEggTop(); drawLine(); } public static void drawEggTop() { System.out.println(" ______"); System.out.println(" / \\"); System.out.println("/ \\"); } public static void drawEggBottom() { System.out.println("\\ /"); System.out.println(" \\______/"); } public static void drawLine() { System.out.println("+--------+"); } }